- frontpage_fragment_cache("list_item_with_distance", listing) do
  .browsing-list-item
    .browsing-list-item-image-container
      - if listing.listing_images.size > 0
        = link_to listing_path(listing.url), class: "browsing-list-item-image-desktop" do
          = image_tag listing.listing_images.first[:small_3x2], { alt: listed_listing_title(listing), class: "home-list-image"}
      - if listing.listing_images.size > 0
        = link_to listing_path(listing.url), class: "browsing-list-item-image-mobile" do
          = image_tag listing.listing_images.first[:thumb], { alt: listed_listing_title(listing), class: "home-list-image"}
    .browsing-list-item-details
      .browsing-list-item-details-right
        .browsing-list-item-price
          - if listing.price
            .browsing-list-item-price-value
              = MoneyViewUtils.to_humanized(listing.price)
            - price_text = nil
            - if listing.quantity.present?
              - price_text = t("listings.form.price.per") + " " + listing.quantity
            - elsif listing.unit_type
              - price_text = price_quantity_per_unit(listing)

            - if price_text.present?
              .browsing-list-item-price-quantity{title: price_text}
                = price_text
          - else
            .browsing-list-item-listing-shape-value
              = shape_name(listing)

      .browse-list-item-details-container
        %h2.browsing-list-item-title
          = link_to listing_path(listing.url) do
            = listing.title
            - if @current_community.show_category_in_listing_list
              %a.browsing-list-item-share-type-link{ href: search_path( transaction_type: shape_name_map[listing.listing_shape_id], view: :list)}
                = icon_tag(listing.icon_name, ["icon-fix"])
                = shape_name(listing)
        - distance = Maybe(listing.distance).or_else(nil)
        - if(show_distance && distance.present?)
          .browsing-list-item-distance
            - dist = format_distance(distance)
            = t("homepage.list_item.distance_away", distance: dist, distance_unit: listing.distance_unit)

        .browsing-list-item-author{ class: (listing.listing_images.size > 0 ? "browsing-list-item-author-with-listing-image" : "browsing-list-item-author-without-listing-image")}
          .browsing-list-item-avatar
            = link_to(person_path(username: listing.author.username), class: "home-fluid-thumbnail-grid-author-avatar-image") do
              = image_tag(listing.author.avatar.thumb || missing_avatar(:thumb))
          .browsing-list-item-author-details
            = link_to(person_path(username: listing.author.username), class: "browsing-list-item-author-name") do
              = PersonViewUtils::person_entity_display_name(listing.author, @current_community.name_display_type)
            .browsing-list-item-author-reviews
              - if listing.author.num_of_reviews > 0
                = icon_tag("testimonial")
                = pluralize(listing.author.num_of_reviews, t("homepage.list_item.review"), t("homepage.list_item.reviews"))

        .browsing-list-item-price-mobile{ class: (listing.listing_images.size > 0 ? "browsing-list-item-price-mobile-with-listing-image" : "browsing-list-item-price-mobile-without-listing-image")}
          - if listing.price
            .browsing-list-item-price-value-mobile
              = MoneyViewUtils.to_humanized(listing.price)
            - price_text = nil
            - if listing.quantity.present?
              - price_text = t("listings.form.price.per") + " " + listing.quantity
            - elsif listing.unit_type
              - price_text = price_quantity_per_unit(listing)
            - if price_text.present?
              .browsing-list-item-price-quantity{ title: price_text}
                = price_text
          - else
            .browsing-list-item-shape-value-mobile
              = shape_name(listing)
